// goods 商品
const db = require("./db/db");
//模型文件
const SingerModel = require("./models/SingerModel");
//导入 goods.json
const singerArr = require("./db/json/singers.json").map((item) => {
  return {
    name: item.singer_name,
    oname: item.other_name,
    mid: item.singer_mid,
    pic: item.singer_pic,
  };
});

db(() => {
  //批量插入
  SingerModel.insertMany(singerArr, (err, data) => {
    if (err) throw err;
    console.log("插入成功");
  });
});
